The Port Structure
Open Transport uses a port structure to describe a port's characteristics, such as its port name, its child ports, whether it is active or disabled, whether it is private or sharable, and the kind of framing it can use.The port structure is defined by the
OTPortRecord
data type.
struct OTPortRecord { OTPortRef fRef; UInt32 fPortFlags; UInt32 fInfoFlags; UInt32 fCapabilities; size_t fNumChildPorts; OTPortRef* fChildPorts; char fPortName[kMaxProviderNameSize]; char fModuleName[kMaxModuleNameSize]; char fSlotID[kMaxSlotIDSize]; char fResourceInfo[kMaxResourceInfoSize]; char fReserved[164]; };
Field Description
fRef
- The port reference; a 32-bit value encoding the port's device type, bus type, slot number, and multiport identifier. For more details, see the next section, "The Port Reference."
fPortFlags
- Flags describing the port's status. Only 1 bit can be set at a time. If no bits are set, the port is currently inactive--that is, it is not in use at this time.
fInfoFlags
- Flags providing additional information about the port.
fCapabilities
- Flags indicating the type of framing capability that a port has. If the port can handle only one type of framing, this field is 0. For example, Ethernet framing uses the following values:
fNumChildPorts
- The number of child ports associated with this port.
fChildPorts
- An array of the port references for the child ports associated with this port.
fPortName
- A unique name for this port. The port name is a zero-
terminated string that can have a maximum length as indicated by the constantkMaxProviderNameSize
.fModuleName
- The name of the actual Streams module that implements the driver for this port. Open Transport uses this name internally; you do not use this name.
fSlotID
- An 8-byte identifier for a port's slot that contains a 7-byte character string plus a zero for termination. This identifier is typically available for PCI cards.
fResourceInfo
- A zero-terminated string that describes a shared library that can handle configuration information for the device. This field contains an identifier that allows Open Transport to access auxiliary information about your driver (Open Transport creates shared library IDs from this string to be able to find these extra shared libraries). This string should either be unique to your driver or should be set to a
NULL
string.fReserved
- Reserved.